﻿

using System;
using System.Web;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected string Appid = "";
        protected string signature = "";
        protected string timestamp = "";
        protected string nonceStr = "";
        protected string url = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Appid = Util.appid;

                //第一步获取jsapi_ticket  及准备其他值
                string ticket = Util.GetJSTicket();

                url = HttpContext.Current.Request.Url.AbsoluteUri;
                timestamp = Util.ConvertDateTimeInt(DateTime.Now).ToString();
                nonceStr = Util.CreateNonceStr();

                ////第二步获取签名 
                signature = Util.GenSignature(ticket, nonceStr, timestamp, url);



                //ticket = JsApiTicketContainer.TryGetTicket(appID, appSecret);
                //JSSDKHelper.GetJsSdkUiPackage(appId, secret, Request.Url.AbsoluteUri);
                ////signature = jssdkhelper.GetSignature(ticket, nonceStr, timestamp, Request.Url.AbsoluteUri.ToString());
                //signature = jssdkhelper.GetSignature(ticket, nonceStr, timestamp, Request.Url.AbsoluteUri.ToString());

            }
        }






    }


}
